﻿<?php

include "../lib/BLL/dmloaidonviBLL.php";

$ds = new dmloaidonviBLL();


if(isset($_POST['Lưu']))
{
    $Ma_DV = $_POST['Ma_DV'];
    $Ten_DV = $_POST['Ten_DV'];
    $dmloai_dv= new dmloaidonviDAL();
    
    $dmloai_dv->setdmloaidonvi($Ma_DV,$Ten_DV);
    
    
    $kq=$ds->insertloaidv($dmloai_dv);
   if($kq==true){
        $b= " Đã thêm loại đơn vị";
     }
    else{
        $b="";
    }
}
else{
    $b="";
}



$smarty->assign('notice',$b);
$a = $ds->getListloaidonvi();
$smarty->assign('a',$a);

$smarty->display('nhom3/dmloaidonvi.tpl'); 
include('footer1.php');  
?>